/**
 * 
 */
package com.googlecode.pcapj;


/**
 * 
 */
class UDPPacketImpl extends PacketImpl implements UDPPacket{
	/**
	 * @param buffer
	 * @param offset
	 * @param length
	 */
	UDPPacketImpl(byte[] buffer, int offset, int length) {
		super(buffer, offset, length);
		
	}

	/* (non-Javadoc)
	 * @see com.googlecode.pcapj.UDPPacket#getSource()
	 */
	public int getSource() {
		return binaryData.getIntFromWord(0);
	}

	/* (non-Javadoc)
	 * @see com.googlecode.pcapj.UDPPacket#getDestination()
	 */
	public int getDestination() {
		return binaryData.getIntFromWord(2);
	}
	
	/* (non-Javadoc)
	 * @see com.googlecode.pcapj.UDPPacket#getTotalLength()
	 */
	public int getLength() {
		return binaryData.getIntFromWord(4);
	}

	/* (non-Javadoc)
	 * @see com.googlecode.pcapj.UDPPacket#getChecksum()
	 */
	public short getChecksum() {
		return binaryData.getShort(6);
	}

	/* (non-Javadoc)
	 * @see com.googlecode.pcapj.UDPPacket#getData()
	 */
	public byte[] getData() {
		return binaryData.getBytes(8, getLength());
	}
}
